Skip to content

fix(ui): add Load More button to desktop session panel#324

Open
dimakis wants to merge 3 commits into
mainfrom
fix/desktop-session-load-more
Open

fix(ui): add Load More button to desktop session panel#324
dimakis wants to merge 3 commits into
mainfrom
fix/desktop-session-load-more

Conversation

@dimakis
Copy link
Copy Markdown
Owner

@dimakis dimakis commented May 15, 2026

Summary

  • Desktop SessionPanel was missing pagination — only the first 20 sessions were visible with no way to load more
  • The useSessionList hook already exposes hasMore/loadMore/loadingMore; the mobile SessionList uses them but desktop never wired them up
  • Added the same "Load More" button (reusing existing .session-load-more CSS class) to the desktop "All" session list

Test plan

  • Open desktop UI, switch to "All" tab in session sidebar
  • Verify "Load More" appears at bottom when >20 sessions exist
  • Click it — older sessions append, button disappears when no more pages
  • Verify button shows "Loading..." while fetching

🤖 Generated with Claude Code

The desktop SessionPanel was not wiring up the pagination props
(hasMore, loadMore, loadingMore) from useSessionList, so users
could only see the first page of sessions. The mobile SessionList
already had this — just needed the same treatment on desktop.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Owner Author

@dimakis dimakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Centaur Review

Found 1 issue(s).

frontend/src/components/SessionPanel.tsx

Clean, minimal change that mirrors the existing mobile Load More pattern exactly — hook contract, CSS class, and conditional rendering all verified. Only gap is missing test coverage for the new button.

  • 🔵 missing_tests (L102): The existing SessionPanel test file (components/tests/SessionPanel.test.tsx) mocks hasMore: false but has no test cases exercising the Load More button — rendering when hasMore is true, the disabled state when loadingMore is true, or that loadMore is called on click. The mobile SessionList page uses the identical pattern and also lacks dedicated tests for it, so this is a pre-existing gap, but worth noting. [fixable]

</button>
</div>
))}
{hasMore && (
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 missing_tests: The existing SessionPanel test file (components/tests/SessionPanel.test.tsx) mocks hasMore: false but has no test cases exercising the Load More button — rendering when hasMore is true, the disabled state when loadingMore is true, or that loadMore is called on click. The mobile SessionList page uses the identical pattern and also lacks dedicated tests for it, so this is a pre-existing gap, but worth noting. [fixable]

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Owner Author

@dimakis dimakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Centaur Review

Found 1 issue(s).

frontend/src/components/__tests__/SessionPanel.test.tsx

Clean, well-tested PR that brings desktop parity with the mobile Load More button. Implementation is correct, mocks match real interfaces, CSS exists, and the only gap is a minor missing negative test case.

  • 🔵 missing_tests: No test verifies that the Load More button is hidden when hasMore is false (the default). A negative case like it('does not render Load More when hasMore is false') with a queryByText('Load More') returning null would make the conditional rendering contract explicit. [fixable]

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant